<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%String path = request.getContextPath() ;%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %> 
<%@ taglib uri="/WEB-INF/tld/ui.tld" prefix="ui" %>
<%@ taglib uri="/WEB-INF/tld/sys.tld" prefix="sys" %>
<!DOCTYPE html>
<html lang="zh-CN" >
<head>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>项目评审流程附加信息</title>
<jsp:include page="../../import.jsp" flush="true" />
</head>
<body class="iframeBody">
<div class="Wrapper">
	<form id="formSet1">
		<div class="fieldset1 tabel_col clearFix">
			<div class="caption">
				<span class="title">项目发起人信息</span>
			</div>
			<div class="fieldBox col_33">
				<div class="label">客户经理</div>
				<div class="field">
					<span name="cstMgrNm" id="cstMgrNm">&nbsp;</span>
				</div>
			</div>
			<div class="fieldBox col_33">
				<div class="label">联系方式</div>
				<div class="field">
					<span name="mp" id="mp">${mp }&nbsp;</span>
				</div>
			</div>
			<div class="fieldBox col_33">
				<div class="label">所属机构</div>
				<div class="field">
					<span name="cstMgrOrgCdNm" id="cstMgrOrgCdNm">&nbsp;</span>
				</div>
			</div>
			<div class="caption">
				<span class="title">承租人信息</span>
			</div>
			<div class="fieldBox col_50">
				<div class="label">承租人姓名</div>
				<div class="field">
					<a href="javascript:showCustomerDetail()" class="link">
						<span name="cstNm" id="cstNm">&nbsp;</span>
					</a>
					<input type="hidden" id="cstId" name="cstId">
					<input type="hidden" id="cstTypCd" name="cstTypCd">
				</div>
			</div>
			<div class="fieldBox col_50">
				<div class="label">承租人实际区域</div>
				<div class="field">
					<jsp:include page="../../system/sysRegion/region.jsp" flush="true">
						<jsp:param name="regionShowLvl" value="1" />
					</jsp:include>
				</div>
			</div>
			<div id="certNoDIV" class="fieldBox col_50">
				<div class="label">承租人证件号</div>
				<div class="field">
					<span name="certNo" id="certNo">&nbsp;</span>
				</div>
			</div>
			<div id="postAddrDIV" class="fieldBox col_50">
				<div class="label">承租人地址</div>
				<div class="field">
					<span name="postAddr" id="postAddr">&nbsp;</span>
				</div>
			</div>
			<div class="fieldBox col_50">
				<div class="label">客户等级</div>
				<div class="field">
					<select name="cstLvlCd" id="cstLvlCd" data-value="${cstLvlCd }">
						<option value=" " checked >请选择</option>
						<c:forEach items="${cstLvlCdList }" var="kv" begin="0" step="1" varStatus="status">
							<option value="${kv.key }">${kv.value }</option>
						</c:forEach>
       				</select>
       				<input id="cstId" name="cstId" value="${cstId}" type="text" style="display: none;">
       				<c:if test="${saveCstLvl == 1 }">
       					<span id="saveCstLvlCd" class="sq-button sq-button-round" onclick="saveCstLvlCd();">保存</span>
       				</c:if>
				</div>
			</div>
			<!-- <div id="marStsCdNmDIV" class="fieldBox col_50">
				<div class="label">承租人婚姻状况</div>
				<div class="field">
					<span name="marStsCdNm" id="marStsCdNm">&nbsp;</span>
				</div>
			</div>
			<div id="rlNmDIV" class="fieldBox col_50">
				<div class="label">承租人配偶姓名</div>
				<div class="field">
					<span name="rlNm" id="rlNm">&nbsp;</span>
				</div>
			</div> -->
			<div class="caption">
				<span class="title">担保人信息</span>
			</div>
			<div id="guarantor" class="fieldBox col_100">
		        <div class="sqPanel">
		            <div class="sqPanel_body">
		                <div id="ligergrid_guarantor" class="sq-grid"></div>
		            </div>
		        </div>
		    </div>
			<div class="caption">
				<span class="title">第三方联系人信息</span>
			</div>
			<div id="linkPerson" class="fieldBox col_100">
		        <div class="sqPanel">
		            <div class="sqPanel_body">
		                <div id="ligergrid_linkPerson" class="sq-grid"></div>
		            </div>
		        </div>
		    </div>
			<div class="caption">
				<span class="title">项目信息及产品政策</span>
			</div>
			<!-- <div class="fieldBox col_33">
				<div class="label">项目名称</div>
				<div class="field">
					<a href="javascript:toPrjDetail()" class="link">
						<span name="prjNm" id="prjNm">&nbsp;</span>
					</a>
				</div>
			</div> -->
			<div class="fieldBox col_33">
				<div class="label">合同编号</div>
				<div class="field">
					<a href="javascript:toPrjDetail()" class="link">
						<span name="lsCntNo" id="lsCntNo">&nbsp;</span>
					</a>
				</div>
			</div>
			<div class="fieldBox col_33">
				<div class="label">代理商类型</div>
				<div class="field">
					<span name="agntTypCdNm" id="agntTypCdNm">&nbsp;</span>
				</div>
			</div>
			<div class="fieldBox col_33">
				<div class="label">业务类型</div>
				<div class="field">
					<span name="bizTypCdNm" id="bizTypCdNm">&nbsp;</span>
				</div>
			</div>
			<div class="fieldBox col_33">
				<div class="label">项目类型</div>
				<div class="field">
					<span name="prjTypCdNm" id="prjTypCdNm">&nbsp;</span>
				</div>
			</div>
			<div class="fieldBox col_33">
				<div class="label">业务来源</div>
				<div class="field">
					<span name="bizResCdNm" id="bizResCdNm">&nbsp;</span>
				</div>
			</div>
			<div class="fieldBox col_33">
				<div class="label">合同总金额</div>
				<div class="field">
					<span name="contAmt" id="contAmt">&nbsp;</span>
				</div>
			</div>
			<div class="fieldBox col_33">
				<div class="label">融资总金额</div>
				<div class="field">
					<span name="actLsAmt" id="actLsAmt">&nbsp;</span>
				</div>
			</div>
			<div class="fieldBox col_33">
				<div class="label">融资期限</div>
				<div class="field">
					<span name="lsPd" id="lsPd">&nbsp;</span>
					<span name="lsPdUntCdNm" id="lsPdUntCdNm">&nbsp;</span>
				</div>
			</div>
			<!-- <div class="fieldBox col_33">
				<div class="label">租赁周期</div>
				<div class="field">
				</div>
			</div> -->
			<div class="fieldBox col_33">
				<div class="label">租赁年利率</div>
				<div class="field">
					<span name="annIntRatePct" id="annIntRatePct">&nbsp;</span>%
				</div>
			</div>
			<div class="fieldBox col_33" style="display: none">
				<div class="label">利率上浮比例</div>
				<div class="field">
					<span name="intRateRsPct" id="intRateRsPct">&nbsp;</span>
				</div>
			</div>
			<div class="fieldBox col_33">
				<div class="label">首付比例</div>
				<div class="field">
					<span name="firstFeePct" id="firstFeePct">&nbsp;</span>%
				</div>
			</div>
			<div class="fieldBox col_33">
				<div class="label">保证金比例</div>
				<div class="field">
					<span name="assureFeePct" id="assureFeePct">&nbsp;</span>%
				</div>
			</div>
			<div class="fieldBox col_33">
				<div class="label">收益率</div>
				<div class="field">
					<span name="irrPct" id="irrPct">&nbsp;</span>%
				</div>
			</div>
			<div class="fieldBox col_33">
				<div class="label">咨询费1</div>
				<div class="field">
					<span name="consultFeeAmt" id="consultFeeAmt">&nbsp;</span>
				</div>
			</div>
			<div class="fieldBox col_33">
				<div class="label">咨询费2</div>
				<div class="field">
					<span name="consultFeeAmt1" id="consultFeeAmt1">&nbsp;</span>
				</div>
			</div>
			<div class="fieldBox col_33">
				<div class="label">留购价</div>
				<div class="field">
					<span name="purchaseFeeAmt" id="purchaseFeeAmt">&nbsp;</span>
				</div>
			</div>
			<div class="fieldBox col_33">
				<div class="label">保险保证金</div>
				<div class="field">
					<span name="insAssureFeeAmt" id="insAssureFeeAmt">&nbsp;</span>
				</div>
			</div>
			<div class="fieldBox col_33">
				<div class="label">首付</div>
				<div class="field">
					<span name="firstFeeAmt" id="firstFeeAmt">&nbsp;</span>
				</div>
			</div>
			<div class="fieldBox col_33">
				<div class="label">月还款</div>
				<div class="field">
					<span name="eachEstRntAmt" id="eachEstRntAmt">&nbsp;</span>
				</div>
			</div>
			<div class="fieldBox col_33" style="display: none">
				<div class="label">融资数量</div>
				<div class="field">
					<span name="" id="">&nbsp;</span>
				</div>
			</div>
			<div class="fieldBox col_33" style="display: none">
				<div class="label">是否挂靠</div>
				<div class="field">
					<span name="" id="">&nbsp;</span>
				</div>
			</div>
			<div class="fieldBox col_33" style="display: none">
				<div class="label">挂靠公司名称</div>
				<div class="field">
					<span name="" id="">&nbsp;</span>
				</div>
			</div>
			<div class="fieldBox col_33" style="display: none">
				<div class="label">挂靠公司归属</div>
				<div class="field">
					<span name="" id="">&nbsp;</span>
				</div>
			</div>
			<div class="fieldBox col_33" style="display: none">
				<div class="label">客户保证金</div>
				<div class="field">
					<span name="assureFeeAmt" id="assureFeeAmt">&nbsp;</span>
				</div>
			</div>
			<div class="fieldBox col_33" style="display: none">
				<div class="label">租赁期满处理方式</div>
				<div class="field">
					<span name="expHdlWayCdNm" id="expHdlWayCdNm">&nbsp;</span>
				</div>
			</div>
			<div class="fieldBox col_33" style="display: none">
				<div class="label">支付方式</div>
				<div class="field">
					<span name="payWayCdNm" id="payWayCdNm">&nbsp;</span>
				</div>
			</div>
			<div class="caption">
		        <span class="title">项目产品信息</span>
		    </div>
		    <div id="truck0" class="fieldBox col_100" style="display: none">
		        <div class="sqPanel">
		            <div class="sqPanel_head inL">
		                <span>卡车</span>
		            </div>
		            <div class="sqPanel_body">
		                <div id="ligergrid_fee_truck" class="sq-grid"></div>
		            </div>
		        </div>
		    </div>
		    <div id="tk_bus0" class="fieldBox col_100" style="display: none">
		        <div class="sqPanel">
		            <div class="sqPanel_head inL">
		                <span>客车</span>
		            </div>
		            <div class="sqPanel_body">
		                <div id="ligergrid_fee_tk_bus" class="sq-grid"></div>
		            </div>
		        </div>
		    </div>
		    <div id="car0" class="fieldBox col_100" style="display: none">
		        <div class="sqPanel">
		            <div class="sqPanel_head inL">
		                <span>乘用车</span>
		            </div>
		            <div class="sqPanel_body">
		                <div id="ligergrid_fee_car" class="sq-grid"></div>
		            </div>
		        </div>
		    </div>
		    <div id="bus0" class="fieldBox col_100" style="display: none">
		        <div class="sqPanel">
		            <div class="sqPanel_head inL">
		                <span>专车</span>
		            </div>
		            <div class="sqPanel_body">
		                <div id="ligergrid_fee_bus" class="sq-grid"></div>
		            </div>
		        </div>
		    </div>
		    <div id="farm0" class="fieldBox col_100" style="display: none">
		        <div class="sqPanel">
		            <div class="sqPanel_head inL">
		                <span>农机</span>
		            </div>
		            <div class="sqPanel_body">
		                <div id="ligergrid_fee_farm" class="sq-grid"></div>
		            </div>
		        </div>
		    </div>
		    <div class="caption">
				<span class="title">信审意见</span>
			</div>
			<div class="fieldBox col_33">
				<div class="label">是否新单</div>
				<div class="field">
					<select name="isNew" id="isNew" data-value=" " validate ="{required:true,select:true}">
						<option value=" " checked >请选择</option>
						<c:forEach items="${yesOrNoCdList }" var="kv">
							<option value="${kv.key }">${kv.value }</option>
						</c:forEach>
					</select>
					<span class="requiredSymbol">*</span>
				</div>
			</div>
			<div class="fieldBox col_33">
				<div class="label">贷前风险标记</div>
				<div class="field">
					<select name="preLoanRiskFlagCd" id="preLoanRiskFlagCd" data-value=" " validate ="{required:true,select:true}">
						<option value=" " checked >请选择</option>
						<c:forEach items="${preLoanRiskFlagCdList }" var="kv">
							<option value="${kv.key }">${kv.value }</option>
						</c:forEach>
					</select>
				</div>
			</div>
			<div class="fieldBox col_33">
				<div class="label">本外地</div>
				<div class="field">
					<select name="localOrNo" id="localOrNo" data-value=" " >
						<option value=" " checked >请选择</option>
						<c:forEach items="${localOrNoList }" var="kv">
							<option value="${kv.key }">${kv.value }</option>
						</c:forEach>
					</select>
				</div>
			</div>
			<div class="fieldBox col_33">
				<div class="label">是否本人接听</div>
				<div class="field">
					<select name="isSelfAnswer" id="isSelfAnswer" data-value=" " >
						<option value=" " checked >请选择</option>
						<c:forEach items="${yesOrNoCdList }" var="kv">
							<option value="${kv.key }">${kv.value }</option>
						</c:forEach>
					</select>
				</div>
			</div>
			<div class="fieldBox col_33">
				<div class="label">身份与购车信息核实</div>
				<div class="field">
					<select name="identityCd" id="identityCd" data-value=" " >
						<option value=" " checked >请选择</option>
						<c:forEach items="${returnVisitConfirmCdList }" var="kv">
							<option value="${kv.key }">${kv.value }</option>
						</c:forEach>
					</select>
				</div>
			</div>
			<div class="fieldBox col_33">
				<div class="label">还款方式</div>
				<div class="field">
					<select name="repayTypCd" id="repayTypCd" data-value=" " >
						<option value=" " checked >请选择</option>
						<c:forEach items="${repayTypCdList }" var="kv">
							<option value="${kv.key }">${kv.value }</option>
						</c:forEach>
					</select>
				</div>
			</div>
			<div class="fieldBox col_33">
				<div class="label">车辆用途</div>
				<div class="field">
					<input name="equipmentUse" id="equipmentUse" type="text" class="ui-textbox" value="" >
				</div>
			</div>
			<div class="fieldBox col_33">
				<div class="label" role="textclip">担保人</div>
				<div class="field">
					<textarea name="guaOpn" id="guaOpn" class="ui-textarea l-textarea" style="width:98%" rows ="1" value="" ></textarea>
				</div>
			</div>
			<div class="fieldBox col_33">
				<div class="label" role="textclip">紧急联系人</div>
				<div class="field">
					<textarea name="ugRlOpn" id="ugRlOpn" class="ui-textarea l-textarea" style="width:98%" rows ="1" value="" ></textarea>
				</div>
			</div>
			<div class="fieldBox col_33">
				<div class="label" role="textclip">资产证明或社保</div>
				<div class="field">
					<textarea name="houseCret" id="houseCret" rows="1" class="ui-textarea l-textarea" style="width:98%"></textarea>
				</div>
			</div>
			<div class="fieldBox col_33">
				<div class="label" role="textclip">收入模式</div>
				<div class="field">
					<textarea name="incomeSchema" id="incomeSchema" rows="1" class="ui-textarea l-textarea" style="width:98%"></textarea>
				</div>
			</div>
			<div class="fieldBox col_33">
				<div class="label" role="textclip">其他</div>
				<div class="field">
					<textarea name="otherInfo" id="otherInfo" rows="1" class="ui-textarea l-textarea" style="width:98%"></textarea>
				</div>
			</div>
			<div class="fieldBox col_33">
				<div class="label" role="textclip">风险分析</div>
				<div class="field">
					<textarea name="riskOpn" id="riskOpn" class="ui-textarea l-textarea" style="width:98%" rows ="1" value="" ></textarea>
				</div>
			</div>
			<div class="fieldBox col_50">
				<div class="label">可操作性评价</div>
				<div class="field">
					<select name="processOpinionCd" id="processOpinionCd" data-value=" " validate ="{required:true,select:true}">
						<option value=" " checked >请选择</option>
						<c:forEach items="${processOpinionCdList }" var="kv">
							<option value="${kv.key }">${kv.value }</option>
						</c:forEach>
					</select>
					<span class="requiredSymbol">*</span>
				</div>
			</div>
			<div class="fieldBox col_100">
				<div class="label">通过意见链接</div>
				<div class="field">
					<a href="<%=path%>/project/audit/toBusAdditionalInfoPage.do?isDetail=1&projectId=${projectId}&processInstanceId=${proIntId}" target="_blank" class="link">
						/project/audit/toBusAdditionalInfoPage.do?isDetail=1&projectId=${projectId}&processInstanceId=${proIntId}
					</a>
				</div>
			</div>
			<c:if test="${isDetail==0 && (buOrgCd==00000001 || buOrgCd==00000009 || buOrgCd==00000008)}">
				<div class="fieldBox col_100">
					<div class="label">征信前置</div>
					<div class="field">
						<a href="javascript:showCreditPrepositionByCertNo()" class="link">
							点击查看
						</a>
					</div>
				</div>
			</c:if>
			<div class="fieldBox col_100">
				<div class="label">客户风险标记</div>
				<div class="field">
						<span name="rskCstSignDesc" id="rskCstSignDesc"  style="color: red">
							${rskCstSignDesc}
						</span>
				</div>
			</div>
			<div class="fieldBox col_100">
				<div class="label">担保人风险标记</div>
				<div class="field">
						<span name="rskGuarSignDesc" id="rskGuarSignDesc"  style="color: red">
							${rskGuarSignDesc}
						</span>
				</div>
			</div>
			<div class="fieldBox col_100">
				<div class="label">设备风险标记</div>
				<div class="field">
						<span name="rskProdSignDesc" id="rskProdSignDesc"  style="color: red">
							${rskProdSignDesc}
						</span>
				</div>
			</div>
			<div class="fieldBox col_100">
				<div class="label">Vin风险标记</div>
				<div class="field">
                        <span name="rskVinSignDesc" id="rskVinSignDesc"  style="color: red">
							${rskVinSignDesc}
						</span>
				</div>
			</div>
			<div class="fieldBox col_100">
				<div class="label">挂靠公司风险标记</div>
				<div class="field">
                        <span name="rskLnkSignDesc" id="rskLnkSignDesc"  style="color: red">
							${rskLnkSignDesc}
						</span>
				</div>
			</div>
			<div class="fieldBox col_100">
				<div class="label">供应商风险标记</div>
				<div class="field">
                        <span name="rskSplSignDesc" id="rskSplSignDesc"  style="color: red">
							${rskSplSignDesc}
						</span>
				</div>
			</div>
			<div class="fieldBox col_100">
				<div class="label">手机号风险标记</div>
				<div class="field">
                        <span name="rskCstMpSignDesc" id="rskCstMpSignDesc"  style="color: red">
							${rskCstMpSignDesc}
						</span>
				</div>
			</div>
		</div>
		<div class="btnsBox">
            <c:if test="${exposureSource == 1 || exposureSource == 2}">
				<sys:funcAuth resCd="statistical">
                	<span id="statistical" class="sq-button sq-button-round" onclick="statistical();" >敞口统计</span>
				</sys:funcAuth>
            </c:if>
			<c:if test="${isDetail==0 }">
				<sys:funcAuth resCd="addCreditInfo">
					<span id="saveBtn1" class="sq-button sq-button-round" onclick="addCreditInfo();">保存至信审基础台账</span>
				</sys:funcAuth>
				<sys:funcAuth resCd="addAudRejectOpinion">
		        	<span id="ccc" class="sq-button sq-button-round" onclick="toCreditRejectOpinionAdd();">信审驳回意见</span>
				</sys:funcAuth>
			</c:if>
			<span id="prjFileInfo" class="sq-button sq-button-round" onclick="toPrjFileInfo();">项目资料信息</span>
			<c:if test="${confirmPay==1 || prjTypCd == 'CDDYWYQ'}">
				<sys:funcAuth resCd="auditPayInfo">
					<span id="payInfo" class="sq-button sq-button-round" onclick="toPayInfoList();">付款审核</span>
				</sys:funcAuth>
			</c:if>
	        <input name="creditInfoId" id="creditInfoId" type="hidden" value="">
	    </div>
	</form>
</div>
<script type="text/javascript">
var _projectId = '${projectId}';//项目ID
var _proIntId = '${proIntId}';//流程实例ID
var _taskId = '${taskId}';//任务节点ID
var _taskDefKey = '${taskDefKey}';//任务节点KEY
var _taskNm = '${taskNm}';//节点名称
var _prdTypCd = '${prdTypCd}';//产品类型
var isDetail = '${isDetail}';
var ctrlKey = '${ctrlKey}';
var exposureSource = '${exposureSource}';
// 信审初审节点flag
var fromCAFlag = '${fromCAFlag}';

var mainData;//信审整体资料信息

var truckGrid;
var tkBusGrid;
var carGrid;
var busGrid;
var farmGrid;
var cstMgrOrgCd;
var buOrgCd;
//担保人信息操作按钮展示状态
var guaraStatus = '${guaraStatus}';

$(function () {
	$('#formSet1').ligerForm({
        validate : true
	});
	var saveCstLvl = '${saveCstLvl}';
	if(saveCstLvl!=1 && liger.get("cstLvlCd")){
		liger.get("cstLvlCd").setDisabled(true);
	}
	
	initPrjInfo();//初始化项目相关详情信息
	initGuarantorList();//初始化担保人列表
	initLinkPersonGrid();//初始化第三方联系人列表
	//refleshDyncPrdOperateDiv();//刷新车辆运营模块动态字段
	initCreditData();//初始化信审整体资料信息
	if(isDetail==1){
		disableFixedFiled();//禁用固定标签
	}
	//判断条件初始化产品列表
	var tCodeString  ='${tCodeString}';
	if(!StringUtils.isEmpty(tCodeString)){
		var tCodeArr = tCodeString.split(";");
		if(tCodeArr.indexOf(AuditConstant.AUD_PRJ_PRD_LIST_PARAM_FOR_TK)>-1){
			initTruckList();//初始化卡车产品列表
		}
		if(tCodeArr.indexOf(AuditConstant.AUD_PRJ_PRD_LIST_PARAM_FOR_TK_BUS)>-1){
			initTkBusList();//初始化卡车客车产品列表
		}
		if(tCodeArr.indexOf(AuditConstant.AUD_PRJ_PRD_LIST_PARAM_FOR_CAR)>-1){
			initCarList();//初始化乘用车车产品列表
		}
		if(tCodeArr.indexOf(AuditConstant.AUD_PRJ_PRD_LIST_PARAM_FOR_BUS)>-1){
			initBusList();//初始化专车产品列表
		}
		if(tCodeArr.indexOf(AuditConstant.AUD_PRJ_PRD_LIST_PARAM_FOR_FARM)>-1){
			initFarmList();//初始化农机产品列表
		}
	}
	/* for(var i=0; i<tCodeArr.length; i++){  
		alert(tCodeArr[i]);
	} */
	valitadeRgnProvCd("formSet1");
	SET_popupIframeHeight();
});

function toAuditOpn(){
	//window.location.href='/project/audit/toAdditionalInfoPage.do?isDetail=1&projectId=${projectId}&processInstanceId=${proIntId}';
	window.open('<%=path%>/project/audit/toAdditionalInfoPage.do?isDetail=1&projectId=${projectId}&processInstanceId=${proIntId}');
}

//请求项目相关展示数据(参数:项目ID)
function initPrjInfo(){
	if(!_projectId){
		return;
	}
   	var _url = '<%=path%>/project/audit/getProjectInfoByPrjId.do';
	$.ajax({
   		type: 'get',
   		dataType:'json',
   		data:{
   			projectId:_projectId
   		},
   		url: _url,
   		success:function(msg){
			if(msg.success == 1){
				setPrjInfoData(msg.data);//设置数据
			}else{
				top.$.ligerDialog.SQalert({content:msg.info, SQ_type: "error"});
			}
		}
	});
}
var _certNo;
var _cstNm;
function setPrjInfoData(data){
	/**项目基本信息*/
	var prjBscinfoVO = data.prjBscinfoVO;
	if(prjBscinfoVO){
		//$("#prjNm").html(prjBscinfoVO.prjNm);
		$("#prjTypCdNm").html(prjBscinfoVO.prjTypCdNm);
		$("#bizTypCdNm").html(prjBscinfoVO.bizTypCdNm);
		$("#agntTypCdNm").html(prjBscinfoVO.agntTypCdNm);
		$("#lsCntNo").html(prjBscinfoVO.lsCntNo);
		$("#bizResCdNm").html(prjBscinfoVO.bizResCdNm);
		$("#cstMgrNm").html(prjBscinfoVO.cstMgrNm);
		$("#cstMgrOrgCdNm").html(prjBscinfoVO.cstMgrOrgCdNm);
		$("#cstNm").html(prjBscinfoVO.cstNm);
		_cstNm = prjBscinfoVO.cstNm;
		cstMgrOrgCd = prjBscinfoVO.cstMgrOrgCd;
		buOrgCd = prjBscinfoVO.buOrgCd;
	}
	/**自然人承租人信息*/
	var cstBscInfoVO = data.cstBscInfoVO;
	_certNo = cstBscInfoVO.certNo;
	
	/* if(cstBscInfoVO && cstBscInfoVO.cstTypCd!=CustomerConstant.CST_TYPE_NP_CD){//不是自然人,没有婚姻状况和配偶信息
		$("#marStsCdNmDIV").hide();
		$("#rlNmDIV").hide();
	} */
	if(cstBscInfoVO){
		$("#cstId").val(cstBscInfoVO.id);
		$("#cstTypCd").val(cstBscInfoVO.cstTypCd);
		
		$("#certNo").html(cstBscInfoVO.certNo);//证件号
		
		var cstNpBscInfoVO = cstBscInfoVO.cstNpBscInfoVO;
		if(cstNpBscInfoVO){
			$("#postAddr").html(cstNpBscInfoVO.postAddr);//通讯地址
			/* $("#marStsCdNm").html(cstNpBscInfoVO.marStsCdNm);
			var cstNpSocialRlVO = cstNpBscInfoVO.cstNpSocialRlVO;
			if(cstNpSocialRlVO){
				$("#rlNm").html(cstNpSocialRlVO.rlNm);
			} */
		}
		var cstCorpBscInfoVO = cstBscInfoVO.cstCorpBscInfoVO;
		if(cstCorpBscInfoVO){
			$("#postAddr").html(cstCorpBscInfoVO.postAddr); //通讯地址
		}
		
	}
	/**报价方案信息*/
	var prjQuatPrpsVO = data.prjQuatPrpsVO;
	if(prjQuatPrpsVO){
		//$("#contAmt").html(prjQuatPrpsVO.contAmt);
		if(prjQuatPrpsVO.contAmt){
			$("#contAmt").text(FormatMoney(parseFloat(prjQuatPrpsVO.contAmt)));//合同总金额
		}
		$("#annIntRatePct").html(prjQuatPrpsVO.annIntRatePct);
		$("#intRateRsPct").html(prjQuatPrpsVO.intRateRsPct);
		//$("#actLsAmt").html(prjQuatPrpsVO.actLsAmt);
		if(prjQuatPrpsVO.actLsAmt){
			$("#actLsAmt").text(FormatMoney(parseFloat(prjQuatPrpsVO.actLsAmt)));//融资总金额
		}
		$("#lsPd").html(prjQuatPrpsVO.lsPd);
		$("#lsPdUntCdNm").html(prjQuatPrpsVO.lsPdUntCdNm);
		$("#expHdlWayCdNm").html(prjQuatPrpsVO.expHdlWayCdNm);
		$("#payWayCdNm").html(prjQuatPrpsVO.payWayCdNm);
		$("#irrPct").html(prjQuatPrpsVO.irrPct);
		$("#eachEstRntAmt").html(prjQuatPrpsVO.eachEstRntAmt);
	}
	/**费用相关*/
	if(data.firstFeeAmt){
		$("#firstFeeAmt").text(FormatMoney(parseFloat(data.firstFeeAmt)));//首期租金
	}
	$("#firstFeePct").html(data.firstFeePct);//首期比例
	if(data.assureFeeAmt){
		$("#assureFeeAmt").text(FormatMoney(parseFloat(data.assureFeeAmt)));//保证金
	}
	$("#assureFeePct").html(data.assureFeePct);//保证金比例
	if(data.consultFeeAmt1!=null){
		$("#consultFeeAmt1").text(FormatMoney(parseFloat(data.consultFeeAmt1)));//咨询费2
	}
	if(data.consultFeeAmt!=null){
		$("#consultFeeAmt").text(FormatMoney(parseFloat(data.consultFeeAmt)));//咨询费1
	}
	if(data.purchaseFeeAmt!=null){
		$("#purchaseFeeAmt").text(FormatMoney(parseFloat(data.purchaseFeeAmt)));//留购价
	}
	if(data.insAssureFeeAmt!=null){
		$("#insAssureFeeAmt").text(FormatMoney(parseFloat(data.insAssureFeeAmt)));//保险保证金
	}
	
}
//初始化担保人列表
function initGuarantorList(){
	if(!_projectId)return;
	guarantorGrid = $("#ligergrid_guarantor").ligerGrid({
        url: '<%=path%>/project/prjcstbscInfo/initGuarantorList.do',
        method: 'get',
        parms:{
        	prjId:_projectId,
        	cstRlTyp:ProjectConstant.CST_RL_SPONSOR
        },
        columns: [
            {display: '担保人姓名', minWidth: 80,
            	render: function (rowdata, rowindex, value){
            		var h='<a href="javascript:toGuarantorDetail(';
                    h+=rowdata.id;
                    h+=","+rowdata.cstTypCd;
                    h+=')">'+rowdata.cstNm+'</a>'
                return h;
            	}	
            },
            {display: '担保人证件号', name: '', minWidth: 100,
            	render: function (rowdata, rowindex, value){
            		var h='';
            		if(StringUtils.isNotEmpty(rowdata.certNo)){
            			h = ''+rowdata.certNo+'';
            		}
            		return h;
            	}
            },
            {display: '担保人婚姻状况', name: '', minWidth: 80,
            	render: function (rowdata, rowindex, value){
            		var h='';
            		if(StringUtils.isNotEmpty(rowdata.cstNpBscInfoVO) && StringUtils.isNotEmpty(rowdata.cstNpBscInfoVO.marStsCdNm)){
            			h = ''+rowdata.cstNpBscInfoVO.marStsCdNm+''; 
            		}
            		return h;
            	}
            },
            {display: '担保人配偶姓名', name: '', minWidth: 80,
            	render: function (rowdata, rowindex, value){
            		var h='';
            		if(StringUtils.isNotEmpty(rowdata.cstNpBscInfoVO) && StringUtils.isNotEmpty(rowdata.cstNpBscInfoVO.cstNpSocialRlVO)){
            			h = ''+rowdata.cstNpBscInfoVO.cstNpSocialRlVO.rlNm+''; 
            		}
            		return h;
            	},
           	},
			{display: '担保合同签署状态', name: 'conSignStsNm', minWidth: 80,
            	render: function (rowdata, rowindex, value){
            		var h='';
            		if(StringUtils.isNotEmpty(rowdata.prjCstBscInfoVO.conSignStsNm)){
            			h = ''+rowdata.prjCstBscInfoVO.conSignStsNm+'';
            		}
            		return h;
            	}
            },
			{display: '担保类型', name: 'guaraTypCdNm', minWidth: 80,
            	render: function (rowdata, rowindex, value){
            		var h='';
            		if(StringUtils.isNotEmpty(rowdata.prjCstBscInfoVO.guaraTypCdNm)){
            			h = ''+rowdata.prjCstBscInfoVO.guaraTypCdNm+'';
            		}
            		return h;
            	}
            },
            {display: '签署方式', name: 'cntTypCdNm', minWidth: 80,
            	render: function (rowdata, rowindex, value){
            		var h='';
            		if(StringUtils.isNotEmpty(rowdata.prjCstBscInfoVO.cntTypCdNm) ){
            			h = ''+rowdata.prjCstBscInfoVO.cntTypCdNm+'';
            		}
            		return h;
            	}
            },
			getNpGuarColumn()
            ],
        onBeforeEdit: function (e) {},
        onBeforeShowData: function(){SetIframe_height();},
        onAfterShowData: function(){SetIframe_height();},
        pageSize:100,
        usePagerOnLessPagesize: false,
        root: 'rows',
        record: 'total',
        hideLoadButton: true,
        width: '100%',
        height: 300,
        heightDiff: -2,
        enabledEdit: true,
        isScroll: false,
        checkbox: false,
        rownumbers: true,
        allowUnSelectRow: true,
        alternatingRow: false
    });
	if(guaraStatus == 2 || guaraStatus == 3){
		guarantorGrid.toggleCol('conSignStsNm', true);
		guarantorGrid.toggleCol('guaraTypCdNm', true);
		guarantorGrid.toggleCol('cntTypCdNm', true);

	}else{
		guarantorGrid.toggleCol('conSignStsNm', false);
		guarantorGrid.toggleCol('guaraTypCdNm', false);
		guarantorGrid.toggleCol('cntTypCdNm', false);
	}
}
//获取操作列
function getNpGuarColumn(){
	if (!(guaraStatus == 2 || guaraStatus == 3)){
		return ;
	}
	var column = {
		display: '操作',
		isSort: false,
		width: 250,
		align:'left',
		render: function (rowdata, rowindex, value){
			var h="";
			if(rowdata.id && rowdata.cstNpBscInfoVO){
                if((guaraStatus==3) && (StringUtils.isEmpty(rowdata.prjCstBscInfoVO.conSignSts) || rowdata.prjCstBscInfoVO.conSignSts==0)){
                    h+='<a class="sq-button-hasicon" href="javascript:removeBtn(';
                    h+="'"+rowdata.prjCstBscInfoVO.id+"',";
                    h+= "'"+rowdata.prjCstBscInfoVO.isPushCon + "',";
                    h+= "'"+rowdata.prjCstBscInfoVO.guaraTypCd + "'";
                    h+=')"><i class="sqBtnIco_7"></i>删除</a>'
                }
                if((guaraStatus==3 || guaraStatus==2) && (StringUtils.isEmpty(rowdata.prjCstBscInfoVO.conSignSts) || rowdata.prjCstBscInfoVO.conSignSts==0)){
                    h+='<a class="sq-button-hasicon" href="javascript:modifyNpGuarBtn(';
                    h+="'"+rowdata.prjCstBscInfoVO.id+"',";
                    h+= "'"+rowdata.prjCstBscInfoVO.isPushCon + "',";
                    h+="'"+rowdata.cstNpBscInfoVO.mp1+"',";
                    h+=')"><i class="sqBtnIco_4"></i>修改</a>'
                }
                h+='<a class="sq-button-hasicon" href="javascript:detailNpGuarBtn(';
                h+="'"+rowdata.prjCstBscInfoVO.id+"',";
                h+="'"+rowdata.cstNpBscInfoVO.mp1+"',";
                h+=')"><i class="sqBtnIco_2"></i>查看</a>'
                if (rowdata.prjCstBscInfoVO.cntTypCd==1 && (StringUtils.isEmpty(rowdata.prjCstBscInfoVO.conSignSts) || rowdata.prjCstBscInfoVO.conSignSts==0) && rowdata.prjCstBscInfoVO.isPushCon==0) {
                    h+='<a class="sq-button-hasicon" href="javascript:pushCon(';
                    h+="'"+rowdata.prjCstBscInfoVO.id+"',";
                    h+="'"+rowdata.prjCstBscInfoVO.guaraTypCd+"'";
                    h+=')"><i class="sqBtnIco_3"></i>推送合同</a>'
                }
            }
		 	return h;
		}
	}
	return column;
}
//查看担保人信息
function detailNpGuarBtn(id,mp1){
		var  url = '<%=path%>/project/prjcstbscInfo/detailNpGuarPage.do?id='+id+'&&mp1='+mp1+'&&showGuarPart='+'1';//showGuarPart=1不展示部分担保人信息
		$.ligerDialog.SQopen({
            height:300,
            width: 600,
            title : '查看担保人信息',
            url: url,
            showMax: false,
            showToggle: true,
            showMin: false,
            isResize: true,
            slide: false,
        });
	}
//修改担保人信息
function modifyNpGuarBtn(id,isPushCon,mp1){
	var  url = '<%=path%>/project/prjcstbscInfo/modifyNpGuarPage.do?id='+id+'&&mp1='+mp1+'&&showGuarPart='+'1'+'&&prjId='+_projectId +'&&isPushCon='+isPushCon;
	$.ligerDialog.SQopen({
		height:300,
		width: 600,
		title : '修改担保人信息',
		url: url,
		showMax: false,
		showToggle: true,
		showMin: false,
		isResize: true,
		slide: false,
	});
}
//推送担保合同
function pushCon(id,guaraTypCd){
    if (!id){
        return;
    }
    var params = {};
    params.id = id;
    params.guaraTypCd = guaraTypCd;
    $.ajax({
        type: 'post',
        dataType:'json',
        data:params,
        url: '<%=path%>/project/prjcstbscInfo/pushCon.do',
        success:function(msg){
             if(msg.success == 1){
                 if(cstTypCd=ProjectConstant.CST_TYP_CD_NP){
                     liger.get("ligergrid_guarantor").reload();
                    };
             }else{
                 top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
             }
        }
    });
}
//删除所选项目客户信息
function removeBtn(id,isPushCon,guaraTypCd){
	$.ligerDialog.confirm(LogUtils.LOG_CMM_DELETE_CONFIRM, function (flag) {
	if(!id || id=="undefined"){
		var manager = $("#ligergrid_guarantor").ligerGetGridManager();
		manager.deleteSelectedRow();
		return;
	}
	if(flag == false)return;
    var params = {};
    params.guaraTypCd = guaraTypCd;
    params.prjId = _projectId;
    params.isPushCon = isPushCon;
    params.id = id;
	$.ajax({
		type: 'post',
		dataType:'json',
		data:params,
		url: '<%=path%>/project/prjcstbscInfo/removeCstAndDelCont.do',
		success:function(msg){
			 if(msg.success == 1){
				 liger.get("ligergrid_guarantor").reload();
			 }else{
				 top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
			 }
		}
		});
	});
}
//紧急联系人初始化列表
function initLinkPersonGrid(){
	$("#ligergrid_linkPerson").ligerGrid({
		url: '<%=path%>/project/prjlinkman/initList.do',
    	method : 'get',
    	 parms:{
         	prjId:_projectId
         },
        columns: [
             { display: '联系人姓名', name: 'lnkNm', minWidth: 140,enabledSort:true},
            { display: '联系电话', name: 'mp', minWidth: 100 ,enabledSort:true},
            { display: '性别', name: 'genderCdNm', minWidth: 140 , enabledSort:true},
            { display: '与承租人关系', name: 'rlCdNm', minWidth: 140 , enabledSort:true},
            { display: '访谈记录', name: 'visRec', minWidth: 140 , enabledSort:true},
            ],
        pageSize:100,
        root:'rows',
        record:'total',
        hideLoadButton : true,
        width: '100%',
        heightDiff:-2,
        checkbox:false,
        allowUnSelectRow: true,
        alternatingRow: false,
        rownumbers:true,
        usePagerOnLessPagesize: false,
    });
}

//请求信审整体资料数据(参数:项目ID,流程实例ID)
function initCreditData(){
	if(!_projectId || !_proIntId){
		return;
	}
   	var _url = '<%=path%>/audit/audCreditInfo/getByProjectIdAndProIntId.do';
	$.ajax({
   		type: 'get',
   		dataType:'json',
   		data:{
   			projectId:_projectId,
   			proIntId:_proIntId
   		},
   		url: _url,
   		success:function(msg){
			if(msg.success == 1){
				setData(msg.data);//设置数据
   				mainData = msg.data;
			}else{
				top.$.ligerDialog.SQalert({content:msg.info, SQ_type: "error"});
			}
		}
	});
}
	
//设置页面数据
function setData(data){
	var form = liger.get("formSet1");
	//设置数据
	$("#creditInfoId").val(data.id);//信审整体资料ID
	$("#equipmentUse").val(data.equipmentUse);
	$("#guaOpn").val(data.guaOpn);
	$("#ugRlOpn").val(data.ugRlOpn);
	$("#houseCret").val(data.houseCret);
	$("#incomeSchema").val(data.incomeSchema);
	$("#otherInfo").val(data.otherInfo);
	$("#riskOpn").val(data.riskOpn);
	form.setData({
		localOrNo:data.localOrNo,
		isSelfAnswer:data.isSelfAnswer,
		identityCd:data.identityCd,
		repayTypCd:data.repayTypCd,
		processOpinionCd:data.processOpinionCd,
	});
	if(null!=data.isNew){
		form.setData({
			isNew:data.isNew.toString(),
		});
	}
	if(null!=data.preLoanRiskFlagCd){
		form.setData({
			preLoanRiskFlagCd:data.preLoanRiskFlagCd.toString(),
		});
	}
	setRgnProvCdUpdataValue(data.actualAreaCd);//实际区域
	setRegionSelectDataChange();
	
};
	
//保存信审整体资料信息
function addCreditInfo(){
    var form = liger.get("formSet1");
    if (!form.valid()) {
    	top.$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO , SQ_type: "warning" });
           return false;
       }
    var data = form.getData();
    data["actualAreaCd"] = getRgnProvCd();//获取省代码(实际区域)
    data["projectId"] = _projectId;//项目ID
    data["proIntId"] = _proIntId;//流程实例ID
    data["prdTypCd"] = _prdTypCd;//刷新动态字段的产品类型依据
    
    data["taskDefKey"] = _taskDefKey;//节点KEY
    data["taskNm"] = _taskNm;//节点名称
    
    if(truckGrid){
	    data["truckInfo"] = JSON.stringify(truckGrid.getData());//卡车列表信息
    }
    if(tkBusGrid){
	    data["tkBusInfo"] = JSON.stringify(tkBusGrid.getData());//卡车类客车列表信息
    }
    if(carGrid){
	    data["carInfo"] = JSON.stringify(carGrid.getData());//乘用车列表信息
    }
    if(busGrid){
	    data["busInfo"] = JSON.stringify(busGrid.getData());//专车列表信息
    }
    if(farmGrid){
	    data["farmInfo"] = JSON.stringify(farmGrid.getData());//农机列表信息
    }
    
    var id = $("#creditInfoId").val();
       var url = '<%=path%>/audit/audCreditInfo/add.do';
       if(id != ""){
       	url = '<%=path%>/audit/audCreditInfo/modify.do';
       	data["id"]= id;
       }
      var wait_dialog;
    $.ajax({
		type: 'post',
		dataType:'json',
		data:data,
		url: url,
		beforeSend: function(){
	          wait_dialog=top.$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" });
	     },
		success:function(msg){
			 wait_dialog.close();
			 if(msg.success == 1){
				 top.$.ligerDialog.SQalert({content:msg.info, SQ_type: "success"});
				 if(msg.data){
					 $("#creditInfoId").val(msg.data);
				 }
				 //TODO
				 //保存成功需要刷新产品列表
				if(truckGrid){
					truckGrid.reload();
			    }
			    if(tkBusGrid){
			    	tkBusGrid.reload();
			    }
			    if(carGrid){
			    	carGrid.reload();
			    }
			    if(busGrid){
			    	busGrid.reload();
			    }
			    if(farmGrid){
			    	farmGrid.reload();
			    }
			 }else{
				 top.$.ligerDialog.SQalert({content:msg.info, SQ_type: "error"});
			 }
		}
	});
}

//设备大类
var equCategoryCdListJSON = [];
<c:if test="${not empty equCategoryCdListJSON}"> equCategoryCdListJSON = ${equCategoryCdListJSON}; </c:if>
//车辆级别
var carLevelCdListJSON = [];
<c:if test="${not empty carLevelCdListJSON}"> carLevelCdListJSON = ${carLevelCdListJSON}; </c:if>
//农机设备大类
var farmEquCategoryCdListJSON = [];
<c:if test="${not empty farmEquCategoryCdListJSON}"> farmEquCategoryCdListJSON = ${farmEquCategoryCdListJSON}; </c:if>

//初始化卡车产品列表数据--truck
function initTruckList(){
	if(!_projectId)return;
	$("#truck0").show();
	truckGrid = $("#ligergrid_fee_truck").ligerGrid({
        url: '<%=path%>/project/audit/initPrjPrdList.do',
        method: 'get',
        parms:{
        	prjId:_projectId,
   			proIntId:_proIntId,
        	audPrjPrdListFlag:AuditConstant.AUD_PRJ_PRD_LIST_PARAM_FOR_TK
        },
        columns: [
            {display: '设备大类', name: 'audCarInfoVO.equCategoryCd',
                editor: {
                    type: 'select',
                    data: equCategoryCdListJSON,
                    valueField: 'key',
                    textField: 'value'
                },
                valueField: 'audCarInfoVO.equCategoryCd',
                textField: 'audCarInfoVO.equCategoryCdNm',
                render: function (item) {
                    return item.audCarInfoVO.equCategoryCdNm;
                }
            },
            {display: '厂商',isEllipsis:false,align:'left',
            	render: function (rowdata, rowindex, value){
           			var h='<a href="javascript:toMfrDetail(';
                        h+="'"+rowdata.mfrId+"'";
                        //h+=",'ligergrid_bankacc'";
                        if(StringUtils.isNotEmpty(rowdata.mfrNm)){
	                        h+=')">'+rowdata.mfrNm+'</a>'
                        }else{
	                        h+=')"></a>'
                        }
                    return h;
            	}	
            },
            {display: '供应商',isEllipsis:false,align:'left',
            	render: function (rowdata, rowindex, value){
            		var h="";
                 	if(rowdata.splId){
                   		if(rowdata.splInfoVO&&rowdata.splInfoVO.audStsCd){
							if(rowdata.splInfoVO.audStsCd!=FlowConstant.FLOW_CHECK_STATE_PASS){
	  		                    	h+='<i class="ico_flasher"></i>';
							}
						}	                    		
                     	h+='<a href="javascript:toSplDetail(';
                        h+="'"+rowdata.splId+"'";
                        if(StringUtils.isNotEmpty(rowdata.splNm)){
	                        h+=')">'+rowdata.splNm+'</a>';
                        }else{
	                        h+=')"></a>';
                        }
                 	}
                 	return h;
            	}	
            },
			{display: '星级',isEllipsis:false,align:'center',
				render: function (rowdata, rowindex, value){
					var h="";
					if (rowdata.splId){
						if(StringUtils.isNotEmpty(rowdata.splStarLevel)){
							h+="<span style='color:red'>"+rowdata.splStarLevel/10+"星</span>";
						}
					}
					return h;
				}
			},
            {display: '设备名',isEllipsis:false,align:'left',
            	render: function (rowdata, rowindex, value){
           			var h='<a href="javascript:toPrdDetail(';
                        h+="'"+rowdata.id+"'";
                        //h+=",'ligergrid_bankacc'";
                        if(StringUtils.isNotEmpty(rowdata.prdNm)){
	                        h+=')">'+rowdata.prdNm+'</a>'
                        }else{
	                        h+=')"></a>'
                        }
                    return h;
            	}	
            },
            {display: '设备类型',align:'left', name: 'prdTypCdNm' },
            {display: '产品编码',isEllipsis:false,align:'left', name: 'prdDtlId' },//卡车类取产品明细ID,乘用车客车产品ID
            {display: '品牌',align:'left', name: 'brCdNm' },
            {display: '型号',isEllipsis:false,align:'left', name: 'prdMdl',
            	render: function (rowdata, rowindex, value){
            		var h = '';
                    if(rowdata.id){
	            		if(rowdata.prdBscInfoVO&&rowdata.prdBscInfoVO.audStsCd){
	            			if(rowdata.prdBscInfoVO.audStsCd!=FlowConstant.FLOW_CHECK_STATE_PASS){
		                    	h+='<i class="ico_flasher"></i>';
		                    }
	            		}
	           		    h+='<a href="javascript:toPrdDetail(';
	                    h+="'"+rowdata.id+"'";
	                    if(StringUtils.isNotEmpty(value)){
		                    h+=')">'+value+'</a>'
	                    }else{
		                    h+=')"></a>'
	                    }
                    }
                    return h;
            	}
            },
            {display: '是否新车', name: 'isNewNm' },
           /*  {display: '使用期限(月)', name: 'usedPd' }, */
            {display: '单价',align:'right', name: 'guidePc' },
            {display: '数量',align:'right', name: 'prdQty' },
            {display: '小计',align:'right', name: 'prdAmt' },
            {display: '留购价',align:'right', name: 'purchaseFeeAmtSum' },
            //getIrrPctColumn(),
            getOperateColumn()
            ],
        onBeforeSubmitEdit: function (e) {
        	/* if(e.column.name=="irrPct"){
        		top.$.ligerDialog.confirm("确认修改收益率吗?", function (flag) {
        				if(!flag){
        					return;
        				}else{
        					modifyIrrPct(e.value,e.record.id);
        				}
        			});
        	} */
        },
        onBeforeEdit: function (e) {
        	if(isDetail==1){
        		e.column.editor.readonly=true;
        	}
        },
        onBeforeShowData: function(){SetIframe_height();},
        onAfterShowData: function(){SetIframe_height();},
        pageSize:100,
        usePagerOnLessPagesize: false,
        root: 'rows',
        record: 'total',
        hideLoadButton: true,
        width: '100%',
        height: 300,
        heightDiff: -2,
        fixedCellHeight:false,
        enabledEdit: true,
        isScroll: false,
        checkbox: false,
        rownumbers: true,
        allowUnSelectRow: true,
        alternatingRow: false
    });
}
//卡车产品列表:收益率列
function getIrrPctColumn(){
	if(isDetail==1){
		return {display: '收益率(%)',align:'right', name: 'irrPct', type: 'numberbox', width:100 }
	}else{
		return {display: '收益率(%)',align:'right', name: 'irrPct', type: 'numberbox', width:100,
	    	editor: {type: 'number',
	    			 precision:2,
	    			 toFix:true,
	                 onToFix:function(){
	                     top.$.ligerDialog.SQalert({SQ_type: "warning",content: "小数点后面最多2位小数！"});
	                 }
	    	} 
	    }
	}
}
//卡车产品列表:操作列
function getOperateColumn(){
	if(isDetail==0){
		return {display: '操作',width: 100,align:'left',
	    	render: function (rowdata, rowindex, value){
	   			var h='<a class="sq-button-hasicon" href="javascript:toCorePrcBookAdd(';
	                h+="'"+rowdata.id+"'";
	                h+=')"><i class="sqBtnIco_4"></i>校准核价</a>';
	            var g='<a class="sq-button-hasicon" href="javascript:modifyIrrPct(';
	        		g+="'"+rowdata.irrPct+"'";
	        		g+=",'"+rowdata.id+"'";
	                g+=')"><i class="sqBtnIco_4"></i>修改收益率</a>';
	            //TODO return g+h;
	            return h;
	    	}
		}
	}else{
		return {display: '操作',width: 100,align:'left',
	    	render: function (rowdata, rowindex, value){
	   			var h='<a class="sq-button-hasicon" href="javascript:toCorePrcBookAdd(';
	                h+="'"+rowdata.id+"'";
	                h+=')"><i class="sqBtnIco_4"></i>核价信息</a>';
	            return h;
	    	}
		}
	}
}
//信审修改收益率
function modifyIrrPct(_irrPct,_prjPrdId){
	if(!_irrPct || !_prjPrdId)return;
	top.$.ligerDialog.confirm("确认修改收益率吗?", function (flag) {
		if(!flag){
			return;
		}else{
			$.ajax({
				type: 'post',
				dataType:'json',
				data:{
					irrPct:_irrPct,
					id:_prjPrdId
				},
				url: '<%=path%>/project/audit/modifyPrjPrdIrrPct.do',
				beforeSend: function(){
			          wait_dialog=top.$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" });
			     },
				success:function(msg){
					 wait_dialog.close();
					 if(msg.success == 1){
						 top.$.ligerDialog.SQalert({content:msg.info, SQ_type: "success"});
					 }else{
						 top.$.ligerDialog.SQalert({content:msg.info, SQ_type: "error"});
					 }
				}
			});
		}
	});
}
function toPrjDetail(){
	if(!_projectId)return;
	// 信审初审节点flag
	Add_navTab("prjDetail"+_projectId, "项目信息", '<%=path%>/project/prjbscinfo/toModifyPage.do?detailFlag=true&id='+_projectId + '&fromCAFlag=' + fromCAFlag);
}
function toMfrDetail(_mfrId){
	if(!_mfrId || _mfrId==null || _mfrId=="null")return;
	Add_navTab("mfrDetail"+_mfrId, "项目产品厂商信息", '<%=path%>/product/mfrInfo/toDetailPage.do?id='+_mfrId);
}
function toSplDetail(_splId){
	if(!_splId || _splId==null || _splId=="null")return;
	Add_navTab("splDetail"+_splId, "项目产品供应商信息", '<%=path%>/product/splInfo/toDetailPage.do?id='+_splId);
}
function toPrdDetail(_prjPrdId){
	if(!_prjPrdId || _prjPrdId==null || _prjPrdId=="null")return;
	///project/prjprdbscinfo/toModifyPage.do?id=161031000000065&&prjId=160829000000052&&detailFlag=true
	Add_navTab("prjPrdDetail"+_prjPrdId, "项目产品详细信息", '<%=path%>/project/prjprdbscinfo/toModifyPage.do?detailFlag=true&&id=' +_prjPrdId+ '&&prjId=' +_projectId);
}

//初始化乘用车产品列表数据--car
function initCarList(){
	if(!_projectId)return;
	$("#car0").show();
	carGrid = $("#ligergrid_fee_car").ligerGrid({
        url: '<%=path%>/project/audit/initPrjPrdList.do',
        method: 'get',
        parms:{
        	prjId:_projectId,
        	proIntId:_proIntId,
        	audPrjPrdListFlag:AuditConstant.AUD_PRJ_PRD_LIST_PARAM_FOR_CAR
        },
        columns: [
            {display: '车辆级别', name: 'audCarInfoVO.carLevelCd', minWidth: 100,
                editor: {
                    type: 'select',
                    data: carLevelCdListJSON,
                    valueField: 'key',
                    textField: 'value'
                },
                valueField: 'audCarInfoVO.carLevelCd',
                textField: 'audCarInfoVO.carLevelCdNm',
                render: function (item) {
                    return item.audCarInfoVO.carLevelCdNm;
                }
            },
            {display: '供应商', minWidth: 150,align:'left',
            	render: function (rowdata, rowindex, value){
           			var h='<a href="javascript:toSplDetail(';
                        h+="'"+rowdata.splId+"'";
                        //h+=",'ligergrid_bankacc'";
                        h+=')">'+rowdata.splNm+'</a>'
                        if(rowdata.splNm){
                        	return h;
                        }
                    return "";
            	}	
            },
			{display: '星级',isEllipsis:false,align:'center',
				render: function (rowdata, rowindex, value){
					var h="";
					if (rowdata.splId){
						if(StringUtils.isNotEmpty(rowdata.splStarLevel)){
							h+="<span style='color:red'>"+rowdata.splStarLevel/10+"星</span>";
						}
					}
					return h;
				}
			},
            {display: '设备名称',align:'left', name: 'prdNm', minWidth: 100 },
            {display: '产品编码',align:'left', name: 'prdId' },//卡车类取产品明细ID,乘用车客车产品ID
            {display: '品牌', name: 'brCdNm', minWidth: 80 },
            {display: '是否新车', name: 'isNewNm', minWidth: 80 },
            {display: '使用期限(月)',align:'right', name: 'usedPd', minWidth: 80 },
            {display: '单价', align:'right',name: 'guidePc', minWidth: 80 },
            {display: '数量', align:'right',name: 'prdQty', minWidth: 80 },
            {display: '小计', align:'right',name: 'prdAmt', minWidth: 80 },
            {display: '留购价', align:'right',name: 'purchaseFeeAmtSum', minWidth: 80 },
            ],
        onBeforeSubmitEdit: function (e) {
        	//alert("onbeforeSubmit");
        },
        onBeforeEdit: function (e) {
        	if(isDetail==1){
        		e.column.editor.readonly=true;
        	}
        },
        onAfterShowData:function (data){
        	SetIframe_height();
        },
        pageSize:100,
        usePagerOnLessPagesize: false,
        root: 'rows',
        record: 'total',
        hideLoadButton: true,
        width: '100%',
        height: 300,
        heightDiff: -2,
        enabledEdit: true,
        isScroll: false,
        checkbox: false,
        rownumbers: true,
        allowUnSelectRow: true,
        alternatingRow: false
    });
}
//初始化卡车客车产品列表数据--tk_bus
function initTkBusList(){
	if(!_projectId)return;
	$("#tk_bus0").show();
	tkBusGrid = $("#ligergrid_fee_tk_bus").ligerGrid({
        url: '<%=path%>/project/audit/initPrjPrdList.do',
        method: 'get',
        parms:{
        	prjId:_projectId,
   			proIntId:_proIntId,
        	audPrjPrdListFlag:AuditConstant.AUD_PRJ_PRD_LIST_PARAM_FOR_TK_BUS
        },
        columns: [
            {display: '设备大类', name: 'audCarInfoVO.equCategoryCd',
                editor: {
                    type: 'select',
                    data: equCategoryCdListJSON,
                    valueField: 'key',
                    textField: 'value'
                },
                valueField: 'audCarInfoVO.equCategoryCd',
                textField: 'audCarInfoVO.equCategoryCdNm',
                render: function (item) {
                    return item.audCarInfoVO.equCategoryCdNm;
                }
            },
            {display: '厂商',isEllipsis:false,align:'left',
            	render: function (rowdata, rowindex, value){
           			var h='<a href="javascript:toMfrDetail(';
                        h+="'"+rowdata.mfrId+"'";
                        //h+=",'ligergrid_bankacc'";
                        if(StringUtils.isNotEmpty(rowdata.mfrNm)){
	                        h+=')">'+rowdata.mfrNm+'</a>'
                        }else{
	                        h+=')"></a>'
                        }
                    return h;
            	}	
            },
            {display: '供应商',isEllipsis:false,align:'left',
            	render: function (rowdata, rowindex, value){
            		var h="";
                 	if(rowdata.splId){
                   		if(rowdata.splInfoVO&&rowdata.splInfoVO.audStsCd){
							if(rowdata.splInfoVO.audStsCd!=FlowConstant.FLOW_CHECK_STATE_PASS){
	  		                    	h+='<i class="ico_flasher"></i>';
							}
						}	                    		
                     	h+='<a href="javascript:toSplDetail(';
                        h+="'"+rowdata.splId+"'";
                        if(StringUtils.isNotEmpty(rowdata.splNm)){
	                        h+=')">'+rowdata.splNm+'</a>';
                        }else{
	                        h+=')"></a>';
                        }
                 	}
                 	return h;
            	}	
            },
			{display: '星级',isEllipsis:false,align:'center',
				render: function (rowdata, rowindex, value){
					var h="";
					if (rowdata.splId){
						if(StringUtils.isNotEmpty(rowdata.splStarLevel)){
							h+="<span style='color:red'>"+rowdata.splStarLevel/10+"星</span>";
						}
					}
					return h;
				}
			},
            {display: '设备名',isEllipsis:false,align:'left',
            	render: function (rowdata, rowindex, value){
           			var h='<a href="javascript:toPrdDetail(';
                        h+="'"+rowdata.id+"'";
                        //h+=",'ligergrid_bankacc'";
                        if(StringUtils.isNotEmpty(rowdata.prdNm)){
	                        h+=')">'+rowdata.prdNm+'</a>'
                        }else{
	                        h+=')"></a>'
                        }
                    return h;
            	}	
            },
            {display: '设备类型',align:'left', name: 'prdTypCdNm' },
            {display: '产品编码',isEllipsis:false,align:'left', name: 'prdDtlId' },//卡车类取产品明细ID,乘用车客车产品ID
            {display: '品牌',align:'left', name: 'brCdNm' },
            {display: '型号',isEllipsis:false,align:'left', name: 'prdMdl',
            	render: function (rowdata, rowindex, value){
            		var h = '';
                    if(rowdata.id){
	            		if(rowdata.prdBscInfoVO&&rowdata.prdBscInfoVO.audStsCd){
	            			if(rowdata.prdBscInfoVO.audStsCd!=FlowConstant.FLOW_CHECK_STATE_PASS){
		                    	h+='<i class="ico_flasher"></i>';
		                    }
	            		}
	           		    h+='<a href="javascript:toPrdDetail(';
	                    h+="'"+rowdata.id+"'";
	                    if(StringUtils.isNotEmpty(value)){
		                    h+=')">'+value+'</a>'
	                    }else{
		                    h+=')"></a>'
	                    }
                    }
                    return h;
            	}	
            },
            {display: '是否新车', name: 'isNewNm' },
           /*  {display: '使用期限(月)', name: 'usedPd' }, */
            {display: '单价',align:'right', name: 'guidePc' },
            {display: '数量',align:'right', name: 'prdQty' },
            {display: '小计',align:'right', name: 'prdAmt' },
            {display: '留购价',align:'right', name: 'purchaseFeeAmtSum' },
            //getIrrPctColumn(),
            getOperateColumn()
            ],
        onBeforeSubmitEdit: function (e) {
        	/* if(e.column.name=="irrPct"){
        		top.$.ligerDialog.confirm("确认修改收益率吗?", function (flag) {
        				if(!flag){
        					return;
        				}else{
        					modifyIrrPct(e.value,e.record.id);
        				}
        			});
        	} */
        },
        onBeforeEdit: function (e) {
        	if(isDetail==1){
        		e.column.editor.readonly=true;
        	}
        },
        onBeforeShowData: function(){SetIframe_height();},
        onAfterShowData: function(){SetIframe_height();},
        pageSize:100,
        usePagerOnLessPagesize: false,
        root: 'rows',
        record: 'total',
        hideLoadButton: true,
        width: '100%',
        height: 300,
        heightDiff: -2,
        fixedCellHeight:false,
        enabledEdit: true,
        isScroll: false,
        checkbox: false,
        rownumbers: true,
        allowUnSelectRow: true,
        alternatingRow: false
    });
}
//初始化专车产品列表数据--bus
function initBusList(){
	if(!_projectId)return;
	$("#bus0").show();
	busGrid = $("#ligergrid_fee_bus").ligerGrid({
        url: '<%=path%>/project/audit/initPrjPrdList.do',
        method: 'get',
        parms:{
        	prjId:_projectId,
        	proIntId:_proIntId,
        	audPrjPrdListFlag:AuditConstant.AUD_PRJ_PRD_LIST_PARAM_FOR_BUS
        },
        columns: [
			{display: '车辆级别', name: 'audCarInfoVO.carLevelCd', minWidth: 100,
			    editor: {
			        type: 'select',
			        data: carLevelCdListJSON,
			        valueField: 'key',
			        textField: 'value'
			    },
			    valueField: 'audCarInfoVO.carLevelCd',
			    textField: 'audCarInfoVO.carLevelCdNm',
			    render: function (item) {
			        return item.audCarInfoVO.carLevelCdNm;
			    }
			},
			{display: '供应商',isEllipsis:false,align:'left',
            	render: function (rowdata, rowindex, value){
            		var h="";
                 	if(rowdata.splId){
                   		if(rowdata.splInfoVO&&rowdata.splInfoVO.audStsCd){
							if(rowdata.splInfoVO.audStsCd!=FlowConstant.FLOW_CHECK_STATE_PASS){
	  		                    	h+='<i class="ico_flasher"></i>';
							}
						}	                    		
                     	h+='<a href="javascript:toSplDetail(';
                        h+="'"+rowdata.splId+"'";
                        if(StringUtils.isNotEmpty(rowdata.splNm)){
	                        h+=')">'+rowdata.splNm+'</a>';
                        }else{
	                        h+=')"></a>';
                        }
                 	}
                 	return h;
            	}	
            },
			{display: '星级',isEllipsis:false,align:'center',
				render: function (rowdata, rowindex, value){
					var h="";
					if (rowdata.splId){
						if(StringUtils.isNotEmpty(rowdata.splStarLevel)){
							h+="<span style='color:red'>"+rowdata.splStarLevel/10+"星</span>";
						}
					}
					return h;
				}
			},
            {display: '设备名',isEllipsis:false,align:'left',
            	render: function (rowdata, rowindex, value){
           			var h='<a href="javascript:toPrdDetail(';
                        h+="'"+rowdata.id+"'";
                        //h+=",'ligergrid_bankacc'";
                        if(StringUtils.isNotEmpty(rowdata.prdNm)){
	                        h+=')">'+rowdata.prdNm+'</a>'
                        }else{
	                        h+=')"></a>'
                        }
                    return h;
            	}	
            },
            /* {display: '设备类型',align:'left', name: 'prdTypCdNm' }, */
            {display: '产品编码',isEllipsis:false,align:'left', name: 'prdId' },//卡车类取产品明细ID,乘用车客车产品ID
            {display: '品牌', name: 'brCdNm' },
            {display: '型号', name: 'prdMdl' },
            /* {display: '型号',isEllipsis:false,align:'left', name: 'prdMdl',
            	render: function (rowdata, rowindex, value){
            		var h = '';
                    if(rowdata.id){
	            		if(rowdata.prdBscInfoVO&&rowdata.prdBscInfoVO.audStsCd){
	            			if(rowdata.prdBscInfoVO.audStsCd!=FlowConstant.FLOW_CHECK_STATE_PASS){
		                    	h+='<i class="ico_flasher"></i>';
		                    }
	            		}
	           		    h+='<a href="javascript:toPrdDetail(';
	                    h+="'"+rowdata.id+"'";
	                    h+=')">'+value+'</a>'
                    }
                    return h;
            	}	
            }, */
            {display: '是否新车', name: 'isNewNm' },
            {display: '单价',align:'right', name: 'guidePc' },
            {display: '数量',align:'right', name: 'prdQty' },
            {display: '小计',align:'right', name: 'prdAmt' },
            {display: '留购价',align:'right', name: 'purchaseFeeAmtSum' },
            /* {display: '车身长度',align:'right', name: 'prjPrdCarInfoVO.carLen', minWidth: 80 },
            {display: '座位数',align:'right', name: 'prjPrdCarInfoVO.seatQtyCdNm', minWidth: 80 },
            {display: '排量',align:'right', name: 'prjPrdCarInfoVO.outVol', minWidth: 80 },
            {display: '驱动',align:'right', name: 'prjPrdCarInfoVO.drvTypCdNm', minWidth: 80 },
            {display: '动力方式', name: 'prjPrdCarInfoVO.powerTypCdNm', minWidth: 80 },
            {display: '是否新车', name: 'isNewNm', minWidth: 50 },
            {display: '使用期限(月)',align:'right', name: 'usedPd', minWidth: 50 },
            {display: '留购价',align:'right', name: 'purchaseFeeAmtSum', minWidth: 80 },
            {display: '指导价',align:'right', name: 'guidePc', minWidth: 80 },
            {display: '数量',align:'right', name: 'prdQty', minWidth: 50 },
            {display: '小计',align:'right', name: 'prdAmt', minWidth: 80 }, */
            ],
        onBeforeSubmitEdit: function (e) {
        	//alert("onbeforeSubmit");
        },
        onBeforeEdit: function (e) {
            //alert(JSON.stringify(e));
        	if(isDetail==1){
        		e.column.editor.readonly=true;
        	}
        },
        onBeforeShowData: function(){SetIframe_height();},
        onAfterShowData: function(){SetIframe_height();},
        pageSize:100,
        usePagerOnLessPagesize: false,
        root: 'rows',
        record: 'total',
        hideLoadButton: true,
        width: '100%',
        height: 300,
        heightDiff: -2,
        fixedCellHeight:false,
        enabledEdit: true,
        isScroll: false,
        checkbox: false,
        rownumbers: true,
        allowUnSelectRow: true,
        alternatingRow: false
    });
}
//初始化农机产品列表数据--farm
function initFarmList(){
	if(!_projectId)return;
	$("#farm0").show();
	farmGrid = $("#ligergrid_fee_farm").ligerGrid({
        url: '<%=path%>/project/audit/initPrjPrdList.do',
        method: 'get',
        parms:{
        	prjId:_projectId,
        	proIntId:_proIntId,
        	audPrjPrdListFlag:AuditConstant.AUD_PRJ_PRD_LIST_PARAM_FOR_FARM
        },
        columns: [
            {display: '设备大类', name: 'equCategoryCd', minWidth: 80,
                editor: {
                    type: 'select',
                    data: farmEquCategoryCdListJSON,
                    valueField: 'key',
                    textField: 'value'
                },
                valueField: 'equCategoryCd',
                textField: 'equCategoryCdNm',
                render: function (item) {
                    return item.equCategoryCdNm;
                }
            },
            {display: '厂商', minWidth: 80,align:'left',
            	render: function (rowdata, rowindex, value){
           			var h='<a href="javascript:toMfrDetail(';
                        h+="'"+rowdata.mfrId+"'";
                        //h+=",'ligergrid_bankacc'";
                        if(StringUtils.isNotEmpty(rowdata.mfrNm)){
	                        h+=')">'+rowdata.mfrNm+'</a>'
                        }else{
	                        h+=')"></a>'
                        }
                    return h;
            	}	
            },
            {display: '供应商', minWidth: 80,align:'left',
            	render: function (rowdata, rowindex, value){
           			var h='<a href="javascript:toSplDetail(';
                        h+="'"+rowdata.splId+"'";
                        //h+=",'ligergrid_bankacc'";
                        if(StringUtils.isNotEmpty(rowdata.splNm)){
	                        h+=')">'+rowdata.splNm+'</a>'
                        }else{
	                        h+=')"></a>'
                        }
                    return h;
            	}	
            },
			{display: '星级',isEllipsis:false,align:'center',
				render: function (rowdata, rowindex, value){
					var h="";
					if (rowdata.splId){
						if(StringUtils.isNotEmpty(rowdata.splStarLevel)){
							h+="<span style='color:red'>"+rowdata.splStarLevel/10+"星</span>";
						}
					}
					return h;
				}
			},
            {display: '设备名',align:'left', name: 'prdNm', minWidth: 80 },
            {display: '车辆型号', name: 'prdMdl', minWidth: 80 },
            {display: '是否新车', name: 'isNewNm', minWidth: 50 },
            {display: '使用期限(月)',align:'right', name: 'usedPd', minWidth: 50 },
            {display: '单价',align:'right', name: 'guidePc', minWidth: 80 },
            {display: '数量',align:'right', name: 'prdQty', minWidth: 50 },
            {display: '小计',align:'right', name: 'prdAmt', minWidth: 80 },
            {display: '留购价',align:'right', name: 'purchaseFeeAmtSum', minWidth: 80 },
            {
                display: '提车日期', name: 'audCarInfoVO.pickDate',
                editor: {type: 'date'},
                render: function (rowdata, index, value) {
                    var result = '';
                    if (value == '') return result;
                    var date = new Date(value);
                    result = date.Format('yyyy-MM-dd');
                    return result;
                }
            },
            {display: '首付款缴纳情况', name: 'audCarInfoVO.firstPaymentInfo', minWidth: 50, editor: {type: 'text'} },
            {display: '设备权益', name: 'audCarInfoVO.equipmentRights', minWidth: 50, editor: {type: 'text'} },
            ],
        onBeforeSubmitEdit: function (e) {
        	//alert("onbeforeSubmit");
        },
        onBeforeEdit: function (e) {
            //alert("obeforeEdit");
            //确认修改收益率 --> 保存
        },
        onAfterShowData:function (data){
        	SetIframe_height();
        },
        pageSize:100,
        usePagerOnLessPagesize: false,
        root: 'rows',
        record: 'total',
        hideLoadButton: true,
        width: '100%',
        height: 300,
        heightDiff: -2,
        enabledEdit: true,
        isScroll: false,
        checkbox: false,
        rownumbers: true,
        allowUnSelectRow: true,
        alternatingRow: false
    });
}

function toCorePrcBookAdd(_prjPrdId){
    /*top.$.ligerDialog.SQopen({
        width: 700,
        height:300,
        title : '核价基础台账',
        url:'<%=path%>/audit/audStandingBook/toCorePrcBookAddPage.do?prjPrdId='+_prjPrdId+'&proIntId='+_proIntId+'&projectId='+_projectId,
        buttons: [{
	            text: "提交核价基础台账", type: 'ok', cls: 'l-dialog-btn-ok',
	            onclick: function (item, Dialog) {
	                if (Dialog.onOk) Dialog.onOk();
	            }
	        }, {
	            text: "关闭", type: 'cancel', cls: 'l-dialog-btn-no',
	            onclick: function (item, Dialog) {
	                if (Dialog.onCancel) Dialog.onCancel();
	            }
	        }
	    ]
    });*/
    Add_navTab("corePrcBook"+_prjPrdId, "车辆配置单", '<%=path%>/audit/audStandingBook/toCorePrcBookAddPage.do?prjPrdId='+_prjPrdId+'&proIntId='+_proIntId+'&projectId='+_projectId+'&isDetail='+isDetail);
}

function toCreditRejectOpinionAdd(){
	var bookTypCd = AuditConstant.AUD_REJECT_BOOK_TYP_CD;//台账类型-信审驳回台账
	var opinionTypeCd = AuditConstant.SYS_FLOW_REJ_RSN_TYP_CD_PRJ;//驳回意见类型-立项驳回
	top.$.ligerDialog.SQopen({
        width: 900,
        height:500,
        top:200,
        title : '信审驳回意见',
        url:'<%=path%>/audit/audRejectOpinion/toAddPage.do?projectId='+_projectId+'&proIntId='+_proIntId+'&taskId='+_taskId+'&taskDefKey='+_taskDefKey+'&opinionTypeCd='+opinionTypeCd+'&bookTypCd='+bookTypCd+'&taskNm='+_taskNm,
        buttons: [{
	            text: "保存", type: 'ok', cls: 'l-dialog-btn-ok',
	            onclick: function (item, Dialog) {
	                if (Dialog.onOk) Dialog.onOk();
	            }
	        }, {
	            text: "关闭", type: 'cancel', cls: 'l-dialog-btn-no',
	            onclick: function (item, Dialog) {
	                if (Dialog.onCancel) Dialog.onCancel();
	            }
	        }
	    ]
    });
}
//当前tab刷新
function callback() {
       //TODO window.location.reload();
	initCreditData();
}
//资料
function toPrjFileInfo(){
    Add_navTab("addPrjFileInfo"+_projectId, "项目资料", '<%=path%>/project/prjFileInfo/toFileInfoListPage.do?prjId='+_projectId+'&ctrlKey='+ctrlKey);
}

//付款审核
function toPayInfoList(){
    Add_navTab("toPayInfoList"+_projectId, "付款审核", '<%=path%>/capPay/flow/toPayInfoList.do?ctrlKey=${ctrlKey}&confirmPay=${confirmPay}&prjId=${projectId}&processInstanceId=${proIntId}&taskId=${taskId}&taskDefKey=${taskDefKey}&taskNm=${taskNm}');
}

//担保人详情
function toGuarantorDetail(_cstId,_cstTypCd){
	if(!_cstId || !_cstTypCd)return;
	if(_cstTypCd == 1){
		Add_navTab('tab_customer_np_detail'+_cstId,'担保人详情','<%=path%>/customer/cstbscinfo/toCustCstBacInfoNpDetailPage.do?id='+_cstId);
	}else if(_cstTypCd == 2){
		Add_navTab('tab_customer_corp_detail'+_cstId,'担保人详情','<%=path%>/customer/cstbscinfo/toCustCstBacInfoCorpDetailPage.do?id='+_cstId);
	}
}
//承租人详情
function showCustomerDetail(_cstId,_cstTypCd){
	var _cstId = $("#cstId").val();
	var _cstTypCd = $("#cstTypCd").val();
	if(!_cstId || !_cstTypCd)return;
	if(_cstTypCd == 1){
		Add_navTab('tab_customer_np_detail'+_cstId,'承租人详情','<%=path%>/customer/cstbscinfo/toCustCstBacInfoNpDetailPage.do?id='+_cstId);
	}else if(_cstTypCd == 2){
		Add_navTab('tab_customer_corp_detail'+_cstId,'承租人详情','<%=path%>/customer/cstbscinfo/toCustCstBacInfoCorpDetailPage.do?id='+_cstId);
	}
}

function showCreditPrepositionByCertNo(){
	var _prjTypCd = '${prjTypCd}';
	var _buOrgCd = '${buOrgCd}';
	if(_buOrgCd=="00000008"){//专车事业部
		if(_certNo){
		    Add_navTab("showCreditPreposition${projectId}"+_certNo, "征信前置查询-"+_cstNm, '<%=path%>/riskctrl/rccstbscinfo/toKcBfRecListPage.do?prjId=${projectId}&certNo='+_certNo);
		}
	}else{
		//重卡事业部 & 传统业务 isShowAc:1
		var isShowAc = '';
		if(_buOrgCd=="00000001" && "CPYW"!=_prjTypCd && "DSFZGCP"!=_prjTypCd){
			isShowAc = '1';
		}
		if(_certNo){
		    Add_navTab("showCreditPreposition${projectId}"+_certNo, "征信前置查询-"+_cstNm, '<%=path%>/riskctrl/rccstbscinfo/toBfRecListPage.do?prjId=${projectId}&certNo='+_certNo+'&isShowAc='+isShowAc);
		}
	}
}

function saveCstLvlCd(){
	var _cstLvlCd = $("#cstLvlCd").val();
	if(!_cstLvlCd || _cstLvlCd==" "){
		top.$.ligerDialog.SQalert({content: "客户等级不能为空.", SQ_type: "warning"});
		return;
	}
	var wait_dialog;
	$.ajax({
		type: 'post',
		dataType:'json',
		data:{
			cstMgrOrgCd:cstMgrOrgCd,
			buOrgCd:buOrgCd,
			cstId:'${cstId}',
			cstLvlCd:_cstLvlCd
		},
		url: '<%=path%>/project/audit/modifyCstLvlCd.do',
		beforeSend: function(){
	          wait_dialog=$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" });
	     },
		success:function(msg){
			 wait_dialog.close();
			 if(msg.success == 1){
				 top.$.ligerDialog.SQalert({content:msg.info, SQ_type: "success"});
			 }else{
				 top.$.ligerDialog.SQalert({content:msg.info, SQ_type: "error"});
			 }
		}
	});
}

//禁用页面固定字段
function disableFixedFiled(){
	disabledRgnProvCd();//禁用区域
	
	if(liger.get("isNew")){
		liger.get("isNew").setDisabled(true);
	}
	if(liger.get("preLoanRiskFlagCd")){
		liger.get("preLoanRiskFlagCd").setDisabled(true);
	}
	if(liger.get("localOrNo")){
		liger.get("localOrNo").setDisabled(true);
	}
	if(liger.get("isSelfAnswer")){
		liger.get("isSelfAnswer").setDisabled(true);
	}
	if(liger.get("identityCd")){
		liger.get("identityCd").setDisabled(true);
	}
	if(liger.get("repayTypCd")){
		liger.get("repayTypCd").setDisabled(true);
	}
	if(liger.get("equipmentUse")){
		liger.get("equipmentUse").setDisabled(true);
	}
	$("#guaOpn").setDisabled_ligerTextarea(true);
	$("#ugRlOpn").setDisabled_ligerTextarea(true);
	$("#houseCret").setDisabled_ligerTextarea(true);
	$("#incomeSchema").setDisabled_ligerTextarea(true);
	$("#otherInfo").setDisabled_ligerTextarea(true);
	if(liger.get("processOpinionCd")){
		liger.get("processOpinionCd").setDisabled(true);
	}
	$("#riskOpn").setDisabled_ligerTextarea(true);
	
}

function statistical(){
    Add_navTab('prjBscInfoForInstitution'+_projectId, "敞口统计","<%=path%>/exposure/capPrjArInfo/toExposureCapPrjArInfoPage.do?prjId="+_projectId+"&ctrlKey="+ctrlKey+"&exposureSource="+exposureSource);
}

</script>
</body>
</html>